package fragment;

import com.android.volley.VolleyError;
import com.qzhy.female.R;

import adapter.SysAdapter;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import utils.HTTPUtils;
import volley.VolleyListener;
import widget.MyListView;

/**
 * A simple {@link Fragment} subclass.
 *
 */
public class ReplyFragment extends Fragment {

	private MyListView mListReply;
	private SysAdapter adapter;
	public ReplyFragment() {
		
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View layout=inflater.inflate(R.layout.fragment_reply, null);
		InitUI(layout);
		getMessage();
		return layout;
	}
	private void getMessage() {
		HTTPUtils.get(getContext(), "", new VolleyListener() {
			
			@Override
			public void onResponse(String arg0) {
				
			}
			@Override
			public void onErrorResponse(VolleyError arg0) {
				Toast.makeText(getContext(), arg0.toString(), 1).show();
			}
		});
	}
	private void InitUI(View layout) {
		mListReply = (MyListView) layout.findViewById(R.id.list_reply);
		adapter = new SysAdapter(getActivity());
		mListReply.setAdapter(adapter);
	}
}
